#--coding:utf-8--



# def mytest(num):
#     return num * 2
#
# def convert(func, seq):
#     'convert sequence of numbers to same type'
#     # 这里遍历集合，得到的每个值，带入传入的函数参数执行，结果返回为一个集合
#     return [func(eachNum) for eachNum in seq]
#
# myseq = [123, 45.67, -6.2e8, 99999999L]
# print convert(int, myseq)
# print convert(long, myseq)
# print convert(float, myseq)
# # 函数式编程，将函数作为参数传入
# print convert(mytest, myseq)


#
# def taxMe(cost, rate=0.0825):
#     return cost + cost * rate
# #
# print taxMe(100)
# print taxMe(100, 0.05)
#
#参数前面有*的是不定长列表参数
# def taxMe2(cost, rate=0.0825, *theRest):
#     for eachRest in theRest:
#         print 'another arg:' , eachRest
#         cost += eachRest
#     return cost + cost * rate
#
# print taxMe2(100, 0.05, 100, 200,300,400)
# 参数前面有两个*的是不定长字典参数
# def taxMe3(cost, rate=0.0825, **theRest):
#     for eachRest in theRest.keys():
#         print 'another arg:' , eachRest
#         cost += theRest[eachRest]
#     return cost + cost * rate
# print taxMe3(100, 0.05, electric=100, water=200, gas=300)


def taxMe4(cost, rate=0.0825, *theRest, **theRest2):
    for i in theRest:
        print(i)
    for eachRest in theRest2.keys():
        print 'another arg:' , eachRest
        cost += theRest2[eachRest]
    return cost + cost * rate

print taxMe4(100, 0.05, 50,100,150, electric=100 ,water=200,gas=30)